home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update20.zoo / util / diffs
Encoding:
Text File  |  1992-04-19  |  34.0 KB  |  1,449 lines

  1. *** 1.26    1992/03/22 21:44:03
  2. --- Changelog    1992/04/19 17:00:12
  3. ***************
  4. *** 272,274 ****
  5. --- 272,297 ----
  6.       free demangled storage.
  7.   
  8.   ----------------------------- Patchlevel 26 ---------------------------------
  9. + ld.c:: Michal
  10. +     clean up compiler noise.
  11. + cnm.c:: andreas
  12. +         adjust proto for ckfread; correctly count symbols if
  13. +     WORD_ALIGNED
  14. + cplusdem.c:: andreas
  15. +         some names couldn't be demangled (like template
  16. +     functions, static members)
  17. + ld.c:: andreas
  18. +         adjust protos for mywrite, xmalloc, xrealloc;
  19. +     initialize gst_symboltable and gst_symbols if CROSSATARI
  20. + strip.c:: andreas
  21. +         preserve long symbols, avoid warnings about cast
  22. + sym-ld.c:: andreas
  23. +          write only the symbols since this is all what gdb needs
  24. + ----------------------------- Patchlevel 27 ---------------------------------
  25. *** 1.24    1992/03/22 21:44:03
  26. --- PatchLev.h    1992/04/19 17:00:13
  27. ***************
  28. *** 1,4 ****
  29. ! #define PatchLevel "26"
  30.   
  31.   /*
  32.    *    the Patch Level above is to identify the version
  33. --- 1,4 ----
  34. ! #define PatchLevel "27"
  35.   
  36.   /*
  37.    *    the Patch Level above is to identify the version
  38. *** 1.5    1992/01/14 19:45:23
  39. --- cnm.c    1992/04/19 17:00:14
  40. ***************
  41. *** 81,87 ****
  42.   int fill8 P_((char *s));
  43.   int not_glob P_((int x));
  44.   void sflags P_((int x));
  45. ! void ckfread P_((char *buf, int siz, int n, FILE *fp));
  46.   int readhead P_((struct hdr *h, int n, FILE *fd));
  47.   int readsyms P_((struct xsym *syms, int n, FILE *fd));
  48.   
  49. --- 81,87 ----
  50.   int fill8 P_((char *s));
  51.   int not_glob P_((int x));
  52.   void sflags P_((int x));
  53. ! void ckfread P_((void *buf, int siz, int n, FILE *fp));
  54.   int readhead P_((struct hdr *h, int n, FILE *fd));
  55.   int readsyms P_((struct xsym *syms, int n, FILE *fd));
  56.   
  57. ***************
  58. *** 230,236 ****
  59. --- 230,240 ----
  60.       }
  61.       len = h.tsize + h.dsize;
  62.       fseek(fd, len, 1);
  63. + #ifndef WORD_ALIGNED
  64.       return h.syms / sizeof(struct sym);
  65. + #else
  66. +     return h.syms / 14;
  67. + #endif
  68.   }
  69.   
  70.   void
  71. ***************
  72. *** 315,321 ****
  73.   
  74.   #ifdef WORD_ALIGNED
  75.   void ckfread(buf, siz, n, fp)
  76. ! char *buf;
  77.   int siz, n;
  78.   FILE *fp;
  79.   {
  80. --- 319,325 ----
  81.   
  82.   #ifdef WORD_ALIGNED
  83.   void ckfread(buf, siz, n, fp)
  84. ! void *buf;
  85.   int siz, n;
  86.   FILE *fp;
  87.   {
  88. *** 1.2    1992/03/08 17:23:52
  89. --- cplusdem.c    1992/04/19 17:00:15
  90. ***************
  91. *** 166,171 ****
  92. --- 166,177 ----
  93.     "cm", ",",            /* ansi */
  94.     "nop", "",            /* old (for operator=) */
  95.     "as", "=",            /* ansi */
  96. +   "cond", "?:",            /* old */
  97. +   "cn", "?:",            /* psuedo-ansi */
  98. +   "max", ">?",            /* old */
  99. +   "mx", ">?",            /* psuedo-ansi */
  100. +   "min", "<?",            /* old */
  101. +   "mn", "<?",            /* psuedo-ansi */
  102.   };
  103.   
  104.   /* Beware: these aren't '\0' terminated. */
  105. ***************
  106. *** 186,194 ****
  107.   static void string_appends (string *p, string *s);
  108.   static void string_appendn (string *p, const char *s, int n);
  109.   static void string_prepend (string *p, const char *s);
  110. - #if 0
  111.   static void string_prepends (string *p, string *s);
  112. - #endif
  113.   static void string_prependn (string *p, const char *s, int n);
  114.   static int get_count (const char **type, int *count);
  115.   static int do_args (const char **type, string *decl);
  116. --- 192,198 ----
  117. ***************
  118. *** 195,200 ****
  119. --- 199,207 ----
  120.   static int do_type (const char **type, string *result);
  121.   static int do_arg (const char **type, string *result);
  122.   static int do_args (const char **type, string *decl);
  123. + static int do_cuv_prefix (const char **type, string *result, int *non_empty);
  124. + static int do_builtin_type (const char **type, string *result, int *non_empty);
  125. + static int do_template_args (const char **type, string *result);
  126.   static void munge_function_name (string *name);
  127.   static void remember_type (const char *type, int len);
  128.   #else
  129. ***************
  130. *** 214,219 ****
  131. --- 221,229 ----
  132.   static int do_type ();
  133.   static int do_arg ();
  134.   static int do_args ();
  135. + static int do_cuv_prefix ();
  136. + static int do_builtin_type ();
  137. + static int do_template_args ();
  138.   static void munge_function_name ();
  139.   static void remember_type ();
  140.   #endif
  141. ***************
  142. *** 275,286 ****
  143.         destructor = 1;
  144.         p = type;
  145.       }
  146. -       /* static data member */
  147. -       else if (*type != '_' && (strchr (type, CPLUS_MARKER) != NULL))
  148. -     {
  149. -       static_type = 1;
  150. -       p = type;
  151. -     }
  152.         /* virtual table "_vt$"  */
  153.         else if (type[0] == '_' && type[1] == 'v' && type[2] == 't' && type[3] == CPLUS_MARKER)
  154.       {
  155. --- 285,290 ----
  156. ***************
  157. *** 290,295 ****
  158. --- 294,305 ----
  159.         strcat (tem, " virtual table");
  160.         return tem;
  161.       }
  162. +       /* static data member */
  163. +       else if (type[0] == '_' && type[1] != '_' && (strchr (type, CPLUS_MARKER) != NULL))
  164. +     {
  165. +       static_type = 1;
  166. +       p = type + 1;
  167. +     }
  168.         else return NULL;
  169.       }
  170.   
  171. ***************
  172. *** 323,334 ****
  173.         string_appendn (&decl, "", 1);
  174.         munge_function_name (&decl);
  175.         if (decl.b[0] == '_')
  176. !         {
  177. !           string_delete (&decl);
  178. !           return NULL;
  179. !         }
  180. !       else
  181. !         p += 2;
  182.       }
  183.         else
  184.       {
  185. --- 333,340 ----
  186.         string_appendn (&decl, "", 1);
  187.         munge_function_name (&decl);
  188.         if (decl.b[0] == '_')
  189. !         decl.p--;
  190. !       p += 2;
  191.       }
  192.         else
  193.       {
  194. ***************
  195. *** 351,363 ****
  196.       {
  197.       case 'C':
  198.         /* a const member function */
  199. !       if (!isdigit (p[1]))
  200.       {
  201.         string_delete (&decl);
  202.         return NULL;
  203.       }
  204. -       p += 1;
  205. -       const_flag = 1;
  206.         /* fall through */
  207.       case '0':
  208.       case '1':
  209. --- 357,371 ----
  210.       {
  211.       case 'C':
  212.         /* a const member function */
  213. !       p += 1;
  214. !       const_flag = 1;
  215. !       if (*p == 't')
  216. !     goto template;
  217. !       if (!isdigit (*p))
  218.       {
  219.         string_delete (&decl);
  220.         return NULL;
  221.       }
  222.         /* fall through */
  223.       case '0':
  224.       case '1':
  225. ***************
  226. *** 416,597 ****
  227.         break;
  228.       /* template additions */
  229.       case 't':
  230.         p += 1;
  231.         {
  232. !     int r, i;
  233. !     int non_empty = 0;
  234.       string tname;
  235.       string trawname;
  236.       
  237. -     string temp;
  238. -     int need_comma = 0;
  239. -     
  240.       string_init(&tname);
  241.       string_init(&trawname);
  242. !     
  243.       /* get template name */
  244.       if (!get_simple_count (&p, &r))
  245.         {
  246. !         string_delete (&decl);
  247. !         return 0;
  248.         }
  249.       string_appendn (&tname, p, r);
  250.       string_appendn (&trawname, p, r);
  251. -     string_appendn (&trawname, "", 1);
  252.       p += r;
  253.       string_append (&tname, "<");
  254. !     /* get size of template parameter list */
  255. !     if (!get_count (&p, &r))
  256. !       return 0;
  257. !     for (i = 0; i < r; i++)
  258.         {
  259. !         if (need_comma)
  260. !           string_append (&tname, ", ");
  261. !         /* Z for type parameters */
  262. !         if (*p == 'Z')
  263. !           {
  264. !         p += 1;
  265. !         
  266. !         success = do_type (&p, &temp);
  267. !         string_appendn (&temp, "", 1);
  268. !         if (success)
  269. !           string_append (&tname, temp.b);
  270. !         string_delete(&temp);
  271. !         if (!success)
  272. !           break;
  273. !           }
  274. !         /* otherwise, value parameter */
  275. !         else
  276. !           {
  277. !         const char *old_p  = p;
  278. !         int is_pointer = 0;
  279. !         int is_real = 0;
  280. !         int is_integral = 0;
  281. !         int done = 0;
  282. !         success = do_type (&p, &temp);
  283. !         string_appendn (&temp, "", 1);
  284. !         if (success)
  285. !           string_append (&tname, temp.b);
  286. !         string_delete(&temp);
  287. !         if (!success)
  288. !           break;
  289. !         string_append (&tname, "=");
  290. !         while (*old_p && !done)
  291. !           {    
  292. !             switch (*old_p)
  293. !               {
  294. !               case 'P':
  295. !               case 'R':
  296. !             done = is_pointer = 1;
  297. !             break;
  298. !               case 'C':    /* const */
  299. !               case 'U':    /* unsigned */
  300. !               case 'V':    /* volatile */
  301. !               case 'F':    /* function */
  302. !               case 'M':    /* member function */
  303. !               case 'O':    /* ??? */
  304. !             old_p++;
  305. !             continue;
  306. !               case 'Q':    /* repetition of following */
  307. !               case 'T':    /* remembered type */
  308. !             abort();
  309. !             break;
  310. !               case 'v':    /* void */
  311. !             abort();
  312. !             break;
  313. !               case 'x':    /* long long */
  314. !               case 'l':    /* long */
  315. !               case 'i':    /* int */
  316. !               case 's':    /* short */
  317. !               case 'c':    /* char */
  318. !             done = is_integral = 1;
  319. !             break;
  320. !               case 'r':    /* long double */
  321. !               case 'd':    /* double */
  322. !               case 'f':    /* float */
  323. !             done = is_real = 1;
  324. !             break;
  325. !               default:
  326. !             abort();
  327. !               }
  328. !           }
  329. !         if (is_integral)
  330. !           {
  331. !             if (*p == 'm')
  332. !               {
  333. !             string_appendn (&tname, "-", 1);
  334. !             p++;
  335. !               }
  336. !             while (isdigit (*p))    
  337. !               {
  338. !             string_appendn (&tname, p, 1);
  339. !             p++;
  340. !               }
  341. !           }
  342. !         else if (is_real)
  343. !           {
  344. !             if (*p == 'm')
  345. !               {
  346. !             string_appendn (&tname, "-", 1);
  347. !             p++;
  348. !               }
  349. !             while (isdigit (*p))    
  350. !               {
  351. !             string_appendn (&tname, p, 1);
  352. !             p++;
  353. !               }
  354. !             if (*p == '.') /* fraction */
  355. !               {
  356. !             string_appendn (&tname, ".", 1);
  357. !             p++;
  358. !             while (isdigit (*p))    
  359. !               {
  360. !                 string_appendn (&tname, p, 1);
  361. !                 p++;
  362. !               }
  363. !               }
  364. !             if (*p == 'e') /* exponent */
  365. !               {
  366. !             string_appendn (&tname, "e", 1);
  367. !             p++;
  368. !             while (isdigit (*p))    
  369. !               {
  370. !                 string_appendn (&tname, p, 1);
  371. !                 p++;
  372. !               }
  373. !               }
  374. !           }
  375. !         else if (is_pointer)
  376. !           {
  377. !             int symbol_len;
  378. !             
  379. !             if (!get_count (&p, &symbol_len))
  380. !               {
  381. !             success = 0;
  382. !             break;
  383. !               }
  384. !             string_appendn (&tname, p, symbol_len);
  385. !             p += symbol_len;
  386. !           }
  387. !           }
  388. !         need_comma = 1;
  389.         }
  390.       string_append (&tname, ">::");
  391.       if (destructor)
  392.         string_append(&tname, "~");
  393. !     if (constructor || destructor) {
  394. !       string_appendn (&trawname, "", 1);
  395. !       string_append (&tname, trawname.b);
  396. !     }
  397.       string_delete(&trawname);
  398. !     
  399.       if (!success) {
  400.         string_delete(&tname);
  401.         return 0;
  402.       }
  403. !     string_appendn (&tname, "", 1);
  404. !     string_prepend (&decl, tname.b);
  405.       string_delete (&tname);
  406.   
  407.       if (static_type)
  408. --- 424,468 ----
  409.         break;
  410.       /* template additions */
  411.       case 't':
  412. +     template:
  413.         p += 1;
  414.         {
  415. !     int r;
  416.       string tname;
  417.       string trawname;
  418.       
  419.       string_init(&tname);
  420.       string_init(&trawname);
  421.       /* get template name */
  422.       if (!get_simple_count (&p, &r))
  423.         {
  424. !         success = 0;
  425. !         break;
  426.         }
  427.       string_appendn (&tname, p, r);
  428.       string_appendn (&trawname, p, r);
  429.       p += r;
  430.       string_append (&tname, "<");
  431. !     success = do_template_args (&p, &tname);
  432. !     if (!success)
  433.         {
  434. !         string_delete (&tname);
  435. !         string_delete (&trawname);
  436. !         break;
  437.         }
  438.       string_append (&tname, ">::");
  439.       if (destructor)
  440.         string_append(&tname, "~");
  441. !     if (constructor || destructor)
  442. !       string_appends (&tname, &trawname);
  443.       string_delete(&trawname);
  444.       if (!success) {
  445.         string_delete(&tname);
  446.         return 0;
  447.       }
  448. !     string_prepends (&decl, &tname);
  449.       string_delete (&tname);
  450.   
  451.       if (static_type)
  452. ***************
  453. *** 602,609 ****
  454.         }
  455.       else
  456.         success = do_args (&p, &decl);
  457. !     break;
  458.         }
  459.       }
  460.   
  461.     for (i = 0; i < ntypes; i++)
  462. --- 473,482 ----
  463.         }
  464.       else
  465.         success = do_args (&p, &decl);
  466. !     if (const_flag)
  467. !       string_append (&decl, " const");
  468.         }
  469. +       break;
  470.       }
  471.   
  472.     for (i = 0; i < ntypes; i++)
  473. ***************
  474. *** 686,692 ****
  475.       case 'Q':
  476.         n = (*type)[1] - '0';
  477.         if (n < 0 || n > 9)
  478. !         success = 0;
  479.         *type += 2;
  480.         while (n-- > 0)
  481.           do_type (type, result);
  482. --- 559,568 ----
  483.       case 'Q':
  484.         n = (*type)[1] - '0';
  485.         if (n < 0 || n > 9)
  486. !         {
  487. !           success = 0;
  488. !           break;
  489. !         }
  490.         *type += 2;
  491.         while (n-- > 0)
  492.           do_type (type, result);
  493. ***************
  494. *** 842,850 ****
  495.       }
  496.   }
  497.   
  498. ! int
  499.   do_cuv_prefix (type, result, non_empty)
  500. !      char **type;
  501.        string* result;
  502.        int* non_empty;
  503.   {
  504. --- 718,726 ----
  505.       }
  506.   }
  507.   
  508. ! static int
  509.   do_cuv_prefix (type, result, non_empty)
  510. !      const char **type;
  511.        string* result;
  512.        int* non_empty;
  513.   {
  514. ***************
  515. *** 887,895 ****
  516.     return success;
  517.   }
  518.   
  519. ! int
  520.   do_builtin_type (type, result, non_empty)
  521. !      char **type;
  522.        string* result;
  523.        int *non_empty;
  524.   {
  525. --- 763,771 ----
  526.     return success;
  527.   }
  528.   
  529. ! static int
  530.   do_builtin_type (type, result, non_empty)
  531. !      const char **type;
  532.        string* result;
  533.        int *non_empty;
  534.   {
  535. ***************
  536. *** 991,996 ****
  537. --- 867,890 ----
  538.         string_appendn (result, *type, n);
  539.         *type += n;
  540.         break;
  541. +     case 't':
  542. +       *type += 1;
  543. +       /* get template name */
  544. +       if (!get_simple_count (type, &n))
  545. +     {
  546. +       success = 0;
  547. +       break;
  548. +     }
  549. +       if (*non_empty)
  550. +     string_append (result, " ");
  551. +       string_appendn (result, *type, n);
  552. +       *type += n;
  553. +       string_append (result, "<");
  554. +       if (!do_template_args (type, result))
  555. +     success = 0;
  556. +       else
  557. +     string_append (result, ">");
  558. +       break;
  559.       default:
  560.         success = 0;
  561.         break;
  562. ***************
  563. *** 998,1003 ****
  564. --- 892,1045 ----
  565.     return success;
  566.   }
  567.   
  568. + static int
  569. + do_template_args (type, result)
  570. +      const char **type;
  571. +      string *result;
  572. + {
  573. +   int r, i;
  574. +   string temp;
  575. +   int need_comma = 0;
  576. +   int success;
  577. +   /* get size of template parameter list */
  578. +   if (!get_count (type, &r))
  579. +     return 0;
  580. +   for (i = 0; i < r; i++)
  581. +     {
  582. +       if (need_comma)
  583. +     string_append (result, ", ");
  584. +       /* Z for type parameters */
  585. +       if (**type == 'Z')
  586. +     {
  587. +       *type += 1;
  588. +       success = do_type (type, &temp);
  589. +       if (success)
  590. +         string_appends (result, &temp);
  591. +       string_delete(&temp);
  592. +       if (!success)
  593. +         break;
  594. +     }
  595. +       /* otherwise, value parameter */
  596. +       else
  597. +     {
  598. +       const char *old_p  = *type;
  599. +       int is_pointer = 0;
  600. +       int is_real = 0;
  601. +       int is_integral = 0;
  602. +       int done = 0;
  603. +       success = do_type (type, &temp);
  604. +       if (success)
  605. +         string_appends (result, &temp);
  606. +       string_delete(&temp);
  607. +       if (!success)
  608. +         break;
  609. +       string_append (result, "=");
  610. +       while (*old_p && !done)
  611. +         {    
  612. +           switch (*old_p)
  613. +         {
  614. +         case 'P':
  615. +         case 'R':
  616. +           done = is_pointer = 1;
  617. +           break;
  618. +         case 'C':    /* const */
  619. +         case 'U':    /* unsigned */
  620. +         case 'V':    /* volatile */
  621. +         case 'F':    /* function */
  622. +         case 'M':    /* member function */
  623. +         case 'O':    /* ??? */
  624. +           old_p++;
  625. +           continue;
  626. +         case 'Q':    /* repetition of following */
  627. +         case 'T':    /* remembered type */
  628. +           abort();
  629. +           break;
  630. +         case 'v':    /* void */
  631. +           abort();
  632. +           break;
  633. +         case 'x':    /* long long */
  634. +         case 'l':    /* long */
  635. +         case 'i':    /* int */
  636. +         case 's':    /* short */
  637. +         case 'c':    /* char */
  638. +           done = is_integral = 1;
  639. +           break;
  640. +         case 'r':    /* long double */
  641. +         case 'd':    /* double */
  642. +         case 'f':    /* float */
  643. +           done = is_real = 1;
  644. +           break;
  645. +         default:
  646. +           abort();
  647. +         }
  648. +         }
  649. +       if (is_integral)
  650. +         {
  651. +           if (**type == 'm')
  652. +         {
  653. +           string_appendn (result, "-", 1);
  654. +           *type++;
  655. +         }
  656. +           while (isdigit (**type))    
  657. +         {
  658. +           string_appendn (result, *type, 1);
  659. +           *type++;
  660. +         }
  661. +         }
  662. +       else if (is_real)
  663. +         {
  664. +           if (**type == 'm')
  665. +         {
  666. +           string_appendn (result, "-", 1);
  667. +           *type++;
  668. +         }
  669. +           while (isdigit (**type))    
  670. +         {
  671. +           string_appendn (result, *type, 1);
  672. +           *type++;
  673. +         }
  674. +           if (**type == '.')    /* fraction */
  675. +         {
  676. +           string_appendn (result, ".", 1);
  677. +           *type++;
  678. +           while (isdigit (**type))    
  679. +             {
  680. +               string_appendn (result, *type, 1);
  681. +               *type++;
  682. +             }
  683. +         }
  684. +           if (**type == 'e')    /* exponent */
  685. +         {
  686. +           string_appendn (result, "e", 1);
  687. +           *type++;
  688. +           while (isdigit (**type))    
  689. +             {
  690. +               string_appendn (result, *type, 1);
  691. +               *type++;
  692. +             }
  693. +         }
  694. +         }
  695. +       else if (is_pointer)
  696. +         {
  697. +           int symbol_len;
  698. +           if (!get_count (type, &symbol_len))
  699. +         {
  700. +           success = 0;
  701. +           break;
  702. +         }
  703. +           string_appendn (result, *type, symbol_len);
  704. +           *type += symbol_len;
  705. +         }
  706. +     }
  707. +       need_comma = 1;
  708. +     }
  709. + }
  710.   /* `result' will be initialised in do_type; it will be freed on failure */
  711.   
  712.   static int
  713. ***************
  714. *** 1321,1327 ****
  715.     string_prependn (p, s, strlen (s));
  716.   }
  717.   
  718. - #if 0
  719.   static void
  720.   string_prepends (p, s)
  721.        string *p, *s;
  722. --- 1363,1368 ----
  723. ***************
  724. *** 1330,1336 ****
  725.       return;
  726.     string_prependn (p, s->b, s->p - s->b);
  727.   }
  728. - #endif
  729.   
  730.   static void
  731.   string_prependn (p, s, n)
  732. --- 1371,1376 ----
  733. *** 1.31    1992/03/22 21:44:03
  734. --- ld.c    1992/04/19 17:00:16
  735. ***************
  736. *** 468,474 ****
  737.   #define RELOC_TYPE(r)        ((r)->r_symbolnum)
  738.   #define RELOC_SYMBOL(r)        ((r)->r_symbolnum)
  739.   #define RELOC_MEMORY_ADD_P(r)    1
  740. ! /* #define RELOC_ADD_EXTRA(r)        0       /* Don't need to define */
  741.   #define RELOC_PCREL_P(r)        ((r)->r_pcrel)
  742.   #define RELOC_VALUE_RIGHTSHIFT(r)    0
  743.   #define RELOC_TARGET_SIZE(r)        ((r)->r_length)
  744. --- 468,474 ----
  745.   #define RELOC_TYPE(r)        ((r)->r_symbolnum)
  746.   #define RELOC_SYMBOL(r)        ((r)->r_symbolnum)
  747.   #define RELOC_MEMORY_ADD_P(r)    1
  748. ! /* #define RELOC_ADD_EXTRA(r)        0     */ /* Don't need to define */
  749.   #define RELOC_PCREL_P(r)        ((r)->r_pcrel)
  750.   #define RELOC_VALUE_RIGHTSHIFT(r)    0
  751.   #define RELOC_TARGET_SIZE(r)        ((r)->r_length)
  752. ***************
  753. *** 1108,1119 ****
  754.   void fatal_with_file P_((char *string, struct file_entry *entry));
  755.   void perror_name P_((char *name));
  756.   void perror_file P_((struct file_entry *entry));
  757. ! void mywrite P_((char *buf, int count, int eltsize, FILE *desc));
  758.   void padfile P_((int padding, FILE *outdesc));
  759.   char *concat P_((char *s1, char *s2, char *s3));
  760.   int parse P_((char *arg, char *format, char *error));
  761. ! int xmalloc P_((int size));
  762. ! int xrealloc P_((char *ptr, int size));
  763.   int write_minix_sym P_((struct nlist *p, char *str, int gflag, int fflag));
  764.   void write_minix_syms P_((struct file_entry *entry, int *syms_written_addr));
  765.   void do_write_minix_out P_((void));
  766. --- 1108,1119 ----
  767.   void fatal_with_file P_((char *string, struct file_entry *entry));
  768.   void perror_name P_((char *name));
  769.   void perror_file P_((struct file_entry *entry));
  770. ! void mywrite P_((void *buf, int count, int eltsize, FILE *desc));
  771.   void padfile P_((int padding, FILE *outdesc));
  772.   char *concat P_((char *s1, char *s2, char *s3));
  773.   int parse P_((char *arg, char *format, char *error));
  774. ! void *xmalloc P_((int size));
  775. ! void *xrealloc P_((void *ptr, int size));
  776.   int write_minix_sym P_((struct nlist *p, char *str, int gflag, int fflag));
  777.   void write_minix_syms P_((struct file_entry *entry, int *syms_written_addr));
  778.   void do_write_minix_out P_((void));
  779. ***************
  780. *** 1125,1131 ****
  781.   #ifndef bcopy
  782.   void bcopy (), bzero ();
  783.   #endif
  784. ! int malloc (), realloc ();
  785.   #ifndef alloca
  786.   int alloca ();
  787.   #endif
  788. --- 1125,1131 ----
  789.   #ifndef bcopy
  790.   void bcopy (), bzero ();
  791.   #endif
  792. ! void *malloc (), *realloc ();
  793.   #ifndef alloca
  794.   int alloca ();
  795.   #endif
  796. ***************
  797. *** 1159,1165 ****
  798.   
  799.     /* Initialize the data about options.  */
  800.   
  801. ! #ifdef atarist
  802.     gst_symboltable = 0;
  803.     gst_symbols = 0;
  804.   #endif
  805. --- 1159,1165 ----
  806.   
  807.     /* Initialize the data about options.  */
  808.   
  809. ! #if defined(atarist) || defined(CROSSATARI)
  810.     gst_symboltable = 0;
  811.     gst_symbols = 0;
  812.   #endif
  813. ***************
  814. *** 1573,1579 ****
  815.                    /* else  "*(cpp = cp) = '\0'"  =>> end */
  816.            n_search_dirs++;
  817.            search_dirs =
  818. !          (char **) xrealloc(search_dirs, n_search_dirs*sizeof(char *));
  819.            search_dirs[n_search_dirs-1] = concat(cpp, "", "");
  820.   #ifdef DEBUG
  821.            fprintf(stderr, "... '%s'\n", search_dirs[n_search_dirs-1]);
  822. --- 1573,1580 ----
  823.                    /* else  "*(cpp = cp) = '\0'"  =>> end */
  824.            n_search_dirs++;
  825.            search_dirs =
  826. !          (char **) xrealloc((char *)search_dirs,
  827. !                     n_search_dirs*sizeof(char *));
  828.            search_dirs[n_search_dirs-1] = concat(cpp, "", "");
  829.   #ifdef DEBUG
  830.            fprintf(stderr, "... '%s'\n", search_dirs[n_search_dirs-1]);
  831. ***************
  832. *** 1590,1596 ****
  833.       int n = sizeof standard_search_dirs / sizeof standard_search_dirs[0];
  834.       n_search_dirs += n;
  835.       search_dirs
  836. !       = (char **) xrealloc (search_dirs, n_search_dirs * sizeof (char *));
  837.       bcopy (standard_search_dirs, &search_dirs[n_search_dirs - n],
  838.          n * sizeof (char *));
  839.     }
  840. --- 1591,1598 ----
  841.       int n = sizeof standard_search_dirs / sizeof standard_search_dirs[0];
  842.       n_search_dirs += n;
  843.       search_dirs
  844. !       = (char **) xrealloc ((char *)search_dirs,
  845. !                 n_search_dirs * sizeof (char *));
  846.       bcopy (standard_search_dirs, &search_dirs[n_search_dirs - n],
  847.          n * sizeof (char *));
  848.     }
  849. ***************
  850. *** 1614,1620 ****
  851.         
  852.         cl_refs_allocated *= 2;
  853.         cmdline_references = (struct glosym **)
  854. !     xrealloc (cmdline_references,
  855.            cl_refs_allocated * sizeof (struct glosym *));
  856.         ptr = cmdline_references + diff;
  857.       }
  858. --- 1616,1622 ----
  859.         
  860.         cl_refs_allocated *= 2;
  861.         cmdline_references = (struct glosym **)
  862. !     xrealloc ((char *)cmdline_references,
  863.            cl_refs_allocated * sizeof (struct glosym *));
  864.         ptr = cmdline_references + diff;
  865.       }
  866. ***************
  867. *** 1690,1696 ****
  868.       case 'L':
  869.         n_search_dirs++;
  870.         search_dirs
  871. !     = (char **) xrealloc (search_dirs, n_search_dirs * sizeof (char *));
  872.         search_dirs[n_search_dirs - 1] = arg;
  873.         return;
  874.   
  875. --- 1692,1699 ----
  876.       case 'L':
  877.         n_search_dirs++;
  878.         search_dirs
  879. !     = (char **) xrealloc ((char *)search_dirs,
  880. !                   n_search_dirs * sizeof (char *));
  881.         search_dirs[n_search_dirs - 1] = arg;
  882.         return;
  883.   
  884. ***************
  885. *** 1902,1908 ****
  886.   file_open (entry)
  887.        register struct file_entry *entry;
  888.   {
  889. !   register FILE *desc;
  890.   
  891.     if (entry->superfile)
  892.       return file_open (entry->superfile);
  893. --- 1905,1911 ----
  894.   file_open (entry)
  895.        register struct file_entry *entry;
  896.   {
  897. !   register FILE *desc = NULL;
  898.   
  899.     if (entry->superfile)
  900.       return file_open (entry->superfile);
  901. ***************
  902. *** 3228,3234 ****
  903.     fprintf (outfile, "  ");
  904.     print_file_name (entry, outfile);
  905.     if (entry->just_syms_flag)
  906. !     fprintf (outfile, " symbols only\n", 0);
  907.     else
  908.       fprintf (outfile, " text %x(%x), data %x(%x), bss %x(%x) hex\n",
  909.            entry->text_start_address, entry->header.a_text,
  910. --- 3231,3237 ----
  911.     fprintf (outfile, "  ");
  912.     print_file_name (entry, outfile);
  913.     if (entry->just_syms_flag)
  914. !     fprintf (outfile, " symbols only\n");
  915.     else
  916.       fprintf (outfile, " text %x(%x), data %x(%x), bss %x(%x) hex\n",
  917.            entry->text_start_address, entry->header.a_text,
  918. ***************
  919. *** 3987,3993 ****
  920.   #endif /* BYTE_SWAP */
  921.   
  922.   # ifndef WORD_ALIGNED
  923. !   mywrite (&outheader, sizeof outheader, 1, outdesc);
  924.   # else
  925.   #  ifndef MINIX
  926.        mywrite (&outheader.a_magic  , sizeof outheader.a_magic  , 1, outdesc);
  927. --- 3990,3996 ----
  928.   #endif /* BYTE_SWAP */
  929.   
  930.   # ifndef WORD_ALIGNED
  931. !   mywrite ((char *)&outheader, sizeof outheader, 1, outdesc);
  932.   # else
  933.   #  ifndef MINIX
  934.        mywrite (&outheader.a_magic  , sizeof outheader.a_magic  , 1, outdesc);
  935. ***************
  936. *** 4046,4052 ****
  937.     /* Write out the set element vectors */
  938.   
  939.     if (set_vector_count)
  940. !     mywrite (set_vectors, set_symbol_count + 2 * set_vector_count, sizeof (unsigned long), outdesc);
  941.   
  942.     if (trace_files)
  943.       fprintf (stderr, "\n");
  944. --- 4049,4057 ----
  945.     /* Write out the set element vectors */
  946.   
  947.     if (set_vector_count)
  948. !     mywrite ((char *) set_vectors,
  949. !          set_symbol_count + 2 * set_vector_count,
  950. !          sizeof (unsigned long), outdesc);
  951.   
  952.     if (trace_files)
  953.       fprintf (stderr, "\n");
  954. ***************
  955. *** 4350,4356 ****
  956.         relocation >>= RELOC_VALUE_RIGHTSHIFT(p);
  957.   
  958.         /* Unshifted mask for relocation */
  959. !       mask = 1 << RELOC_TARGET_BITSIZE(p) - 1;
  960.         mask |= mask - 1;
  961.         relocation &= mask;
  962.   
  963. --- 4355,4361 ----
  964.         relocation >>= RELOC_VALUE_RIGHTSHIFT(p);
  965.   
  966.         /* Unshifted mask for relocation */
  967. !       mask = 1 << (RELOC_TARGET_BITSIZE(p) - 1);
  968.         mask |= mask - 1;
  969.         relocation &= mask;
  970.   
  971. ***************
  972. *** 4763,4773 ****
  973.     sym.a_value = p->n_value;
  974.   
  975.   #ifndef WORD_ALIGNED
  976. !   mywrite(&sym, sizeof sym, 1, outdesc);
  977.     if (i > 0)
  978.       {
  979.         (void) strncpy ((char *) &sym, str, (size_t)i);
  980. !       mywrite(&sym, sizeof sym, 1, outdesc);
  981.       }
  982.   #else
  983.     mywrite(sym.a_name , sizeof sym.a_name , 1, outdesc);
  984. --- 4768,4778 ----
  985.     sym.a_value = p->n_value;
  986.   
  987.   #ifndef WORD_ALIGNED
  988. !   mywrite((char *)&sym, sizeof sym, 1, outdesc);
  989.     if (i > 0)
  990.       {
  991.         (void) strncpy ((char *) &sym, str, (size_t)i);
  992. !       mywrite((char *)&sym, sizeof sym, 1, outdesc);
  993.       }
  994.   #else
  995.     mywrite(sym.a_name , sizeof sym.a_name , 1, outdesc);
  996. ***************
  997. *** 5742,5748 ****
  998.   
  999.   void
  1000.   mywrite (buf, count, eltsize, desc)
  1001. !      char *buf;
  1002.        int count;
  1003.        int eltsize;
  1004.        FILE *desc;
  1005. --- 5747,5753 ----
  1006.   
  1007.   void
  1008.   mywrite (buf, count, eltsize, desc)
  1009. !      void *buf;
  1010.        int count;
  1011.        int eltsize;
  1012.        FILE *desc;
  1013. ***************
  1014. *** 5808,5818 ****
  1015.   
  1016.   /* Like malloc but get fatal error if memory is exhausted.  */
  1017.   
  1018. ! int
  1019.   xmalloc (size)
  1020.        int size;
  1021.   {
  1022. !   register int result = malloc (size);
  1023.     if (!result)
  1024.       fatal ("virtual memory exhausted", 0);
  1025.     return result;
  1026. --- 5813,5823 ----
  1027.   
  1028.   /* Like malloc but get fatal error if memory is exhausted.  */
  1029.   
  1030. ! void *
  1031.   xmalloc (size)
  1032.        int size;
  1033.   {
  1034. !   register void *result = malloc (size);
  1035.     if (!result)
  1036.       fatal ("virtual memory exhausted", 0);
  1037.     return result;
  1038. ***************
  1039. *** 5820,5831 ****
  1040.   
  1041.   /* Like realloc but get fatal error if memory is exhausted.  */
  1042.   
  1043. ! int
  1044.   xrealloc (ptr, size)
  1045. !      char *ptr;
  1046.        int size;
  1047.   {
  1048. !   register int result = realloc (ptr, size);
  1049.     if (!result)
  1050.       fatal ("virtual memory exhausted", 0);
  1051.     return result;
  1052. --- 5825,5836 ----
  1053.   
  1054.   /* Like realloc but get fatal error if memory is exhausted.  */
  1055.   
  1056. ! void *
  1057.   xrealloc (ptr, size)
  1058. !      void *ptr;
  1059.        int size;
  1060.   {
  1061. !   register void *result = realloc (ptr, size);
  1062.     if (!result)
  1063.       fatal ("virtual memory exhausted", 0);
  1064.     return result;
  1065. *** 1.5    1992/01/14 19:45:23
  1066. --- strip.c    1992/04/19 17:00:18
  1067. ***************
  1068. *** 49,57 ****
  1069.   
  1070.   #include <fcntl.h>
  1071.   
  1072. - #ifdef __GNUC__
  1073. - #define NULL        ((void *)0)
  1074. - #endif
  1075.   #define NEWBUFSIZ    16384L
  1076.   
  1077.   char            mybuf[NEWBUFSIZ];
  1078. --- 49,54 ----
  1079. ***************
  1080. *** 58,67 ****
  1081.   char            tmpname[128];
  1082.   
  1083.   #define SYMLEN 8
  1084.   
  1085. ! typedef char    symstr_t[SYMLEN];
  1086. ! symstr_t        stklist[] = {{'_', '_', 's', 't', 'k', 's', 'i', 'z',},
  1087. !                  {'\0'}};
  1088.   
  1089.   #ifdef atarist
  1090.   long            _stksize = 1L;
  1091. --- 55,64 ----
  1092.   char            tmpname[128];
  1093.   
  1094.   #define SYMLEN 8
  1095. + #define GST_SYMLEN 22
  1096.   
  1097. ! typedef char    symstr_t[GST_SYMLEN];
  1098. ! symstr_t        stklist[] = {"__stksize", "__initial_stack"};
  1099.   
  1100.   #ifdef atarist
  1101.   long            _stksize = 1L;
  1102. ***************
  1103. *** 124,130 ****
  1104.           --argc;
  1105.           argv++;
  1106.           }
  1107. !         if ((symstr_t *) 0 == (nmlist = mklist (*argv)))
  1108.           usage ("cannot create a list of reserved names\r\n");
  1109.           select = sel_listed;
  1110.           break;
  1111. --- 121,127 ----
  1112.           --argc;
  1113.           argv++;
  1114.           }
  1115. !         if ((symstr_t *) NULL == (nmlist = mklist (*argv)))
  1116.           usage ("cannot create a list of reserved names\r\n");
  1117.           select = sel_listed;
  1118.           break;
  1119. ***************
  1120. *** 227,233 ****
  1121.   
  1122.   #if !__STDC__ && !__cplusplus
  1123.   #  ifndef offsetof
  1124. ! #    define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
  1125.   #  endif
  1126.   #  ifndef CROSSHPUX
  1127.        typedef unsigned long size_t;
  1128. --- 224,230 ----
  1129.   
  1130.   #if !__STDC__ && !__cplusplus
  1131.   #  ifndef offsetof
  1132. ! #    define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0L)->MEMBER)
  1133.   #  endif
  1134.   #  ifndef CROSSHPUX
  1135.        typedef unsigned long size_t;
  1136. ***************
  1137. *** 305,311 ****
  1138.       close (fd);
  1139.       return 0x80;
  1140.       }
  1141. !     if ((long(*)())0 == select) {     /* remove whole symbol table */
  1142.       lbytes = 0L;
  1143.       if (lseek (fd, sbytes, 1) < 0) {
  1144.           report (name);
  1145. --- 302,308 ----
  1146.       close (fd);
  1147.       return 0x80;
  1148.       }
  1149. !     if (NULL == select) {     /* remove whole symbol table */
  1150.       lbytes = 0L;
  1151.       if (lseek (fd, sbytes, 1) < 0) {
  1152.           report (name);
  1153. ***************
  1154. *** 410,416 ****
  1155.   char * fname;
  1156.   {
  1157.       FILE           *fp;
  1158. !     symstr_t       *list = (symstr_t *) 0;
  1159.       int             left = 0;
  1160.       int             pos = 0;
  1161.       int             i;
  1162. --- 407,413 ----
  1163.   char * fname;
  1164.   {
  1165.       FILE           *fp;
  1166. !     symstr_t       *list = (symstr_t *) NULL;
  1167.       int             left = 0;
  1168.       int             pos = 0;
  1169.       int             i;
  1170. ***************
  1171. *** 418,424 ****
  1172. --- 415,425 ----
  1173.       char            lbuf[LBUFSIZE];
  1174.       char           *in, *out;
  1175.   
  1176. + #ifdef atarist
  1177. +     if (NULL == (fp = fopen (fname, "rt"))) {
  1178. + #else
  1179.       if (NULL == (fp = fopen (fname, "r"))) {
  1180. + #endif
  1181.       report (fname);
  1182.       report (" -- ");
  1183.       usage ("cannot open this file\r\n");
  1184. ***************
  1185. *** 427,433 ****
  1186.       while (NULL != fgets (lbuf, LBUFSIZE, fp)) {
  1187.       if (0 == left) {
  1188.           max_size += NMSTEP;
  1189. !         if ((symstr_t *)0 == list) {
  1190.           list = (symstr_t *) malloc ( max_size * sizeof (symstr_t));
  1191.           }
  1192.           else {
  1193. --- 428,434 ----
  1194.       while (NULL != fgets (lbuf, LBUFSIZE, fp)) {
  1195.       if (0 == left) {
  1196.           max_size += NMSTEP;
  1197. !         if ((symstr_t *) NULL == list) {
  1198.           list = (symstr_t *) malloc ( max_size * sizeof (symstr_t));
  1199.           }
  1200.           else {
  1201. ***************
  1202. *** 435,441 ****
  1203.                            max_size * sizeof (symstr_t));
  1204.   
  1205.           }
  1206. !         if ((symstr_t *)0 == list) {
  1207.           report ("out of memory making symbol list\r\n");
  1208.           exit (-3);
  1209.           }
  1210. --- 436,442 ----
  1211.                            max_size * sizeof (symstr_t));
  1212.   
  1213.           }
  1214. !         if ((symstr_t *) NULL == list) {
  1215.           report ("out of memory making symbol list\r\n");
  1216.           exit (-3);
  1217.           }
  1218. ***************
  1219. *** 448,456 ****
  1220.       if ('\n' == *in)
  1221.           continue;        /* empty line - skip it */
  1222.       out = &list[pos][0];
  1223. !     for (i = SYMLEN; i > 0; --i) {
  1224.           if ('\n' == *in || ' ' == *in || '\t' == *in) {
  1225. !         *out = '\0';
  1226.           break;
  1227.           }
  1228.           *out++ = *in++;
  1229. --- 449,457 ----
  1230.       if ('\n' == *in)
  1231.           continue;        /* empty line - skip it */
  1232.       out = &list[pos][0];
  1233. !     for (i = GST_SYMLEN; i > 0; --i) {
  1234.           if ('\n' == *in || ' ' == *in || '\t' == *in) {
  1235. !         while (i-- > 0) *out++ = '\0';
  1236.           break;
  1237.           }
  1238.           *out++ = *in++;
  1239. ***************
  1240. *** 458,464 ****
  1241.       pos++;
  1242.       --left;
  1243.       }                /* while */
  1244. !     if ((symstr_t *)0 != list) {
  1245.       list[pos][0] = '\0';    /* terminate created list */
  1246.       }
  1247.       return (list);
  1248. --- 459,465 ----
  1249.       pos++;
  1250.       --left;
  1251.       }                /* while */
  1252. !     if ((symstr_t *) NULL != list) {
  1253.       list[pos][0] = '\0';    /* terminate created list */
  1254.       }
  1255.       return (list);
  1256. ***************
  1257. *** 530,536 ****
  1258.       symstr_t       *kname;
  1259.       struct asym     cur_sym, spare;
  1260.   
  1261. !     if ((symstr_t *) 0 == nmlist)
  1262.       return (0L);
  1263.   
  1264.       while (sbytes) {
  1265. --- 531,537 ----
  1266.       symstr_t       *kname;
  1267.       struct asym     cur_sym, spare;
  1268.   
  1269. !     if ((symstr_t *) NULL == nmlist)
  1270.       return (0L);
  1271.   
  1272.       while (sbytes) {
  1273. ***************
  1274. *** 541,548 ****
  1275.       }
  1276.       for (kname = nmlist; '\0' != **kname; kname++) {
  1277.           if (0 == strncmp (&(*kname)[0], &cur_sym.a_name[0], SYMLEN)) {
  1278. !         if (A_LNAM & cur_sym.a_type) { /* if extended */
  1279. !             cur_sym.a_type ^= A_LNAM;
  1280.               if ((long)SIZEOF_ASYM != lread (fd, &spare,
  1281.                           (long)SIZEOF_ASYM)) {
  1282.               report ("error on reading symbol table\r\n");
  1283. --- 542,548 ----
  1284.       }
  1285.       for (kname = nmlist; '\0' != **kname; kname++) {
  1286.           if (0 == strncmp (&(*kname)[0], &cur_sym.a_name[0], SYMLEN)) {
  1287. !         if ((A_LNAM & cur_sym.a_type) == A_LNAM) { /* if extended */
  1288.               if ((long)SIZEOF_ASYM != lread (fd, &spare,
  1289.                           (long)SIZEOF_ASYM)) {
  1290.               report ("error on reading symbol table\r\n");
  1291. ***************
  1292. *** 549,554 ****
  1293. --- 549,557 ----
  1294.               goto leave;  /* skip two loop levels */
  1295.               }
  1296.               sbytes -= SIZEOF_ASYM;
  1297. +             if (strncmp (&(*kname)[SYMLEN], (char *)&spare,
  1298. +                  GST_SYMLEN-SYMLEN))
  1299. +               continue;
  1300.           }
  1301.           if ((long)SIZEOF_ASYM != lwrite (tfd, &cur_sym,
  1302.                           (long)SIZEOF_ASYM)) {
  1303. ***************
  1304. *** 555,560 ****
  1305. --- 558,572 ----
  1306.               report ("error on writing symbol table\r\n");
  1307.               goto leave;
  1308.           }
  1309. +         if ((cur_sym.a_type & A_LNAM) == A_LNAM)
  1310. +           {
  1311. +             if (lwrite (tfd, &spare, (long)SIZEOF_ASYM) != SIZEOF_ASYM)
  1312. +               {
  1313. +             report ("error on writing symbol table\r\n");
  1314. +             goto leave;
  1315. +               }
  1316. +             lbytes += SIZEOF_ASYM;
  1317. +           }
  1318.           lbytes += SIZEOF_ASYM;
  1319.           break;
  1320.           }
  1321. ***************
  1322. *** 564,570 ****
  1323.   leave:
  1324.       if (nmlist != stklist) {
  1325.       free (nmlist);
  1326. !     nmlist = (symstr_t *) 0;
  1327.       }
  1328.       return (lbytes);
  1329.   }
  1330. --- 576,582 ----
  1331.   leave:
  1332.       if (nmlist != stklist) {
  1333.       free (nmlist);
  1334. !     nmlist = (symstr_t *) NULL;
  1335.       }
  1336.       return (lbytes);
  1337.   }
  1338. *** 1.17    1992/03/22 21:44:03
  1339. --- sym-ld.c    1992/04/19 17:00:19
  1340. ***************
  1341. *** 175,180 ****
  1342. --- 175,183 ----
  1343.   #    include <unistd.h>
  1344.   #  endif
  1345.   #endif        /* atarist */
  1346. + #define ONLY_SYMBOLS
  1347.   #endif
  1348.   
  1349.   /* If compiled with GNU C, use the built-in alloca */
  1350. ***************
  1351. *** 3439,3444 ****
  1352. --- 3442,3449 ----
  1353.     /* Output the a.out header.  */
  1354.     write_header ();
  1355.   
  1356. +   /* for the atari, we only want the symbols */
  1357. + #if !defined(ONLY_SYMBOLS)
  1358.     /* Output the text and data segments, relocating as we go.  */
  1359.     write_text ();
  1360.     write_data ();
  1361. ***************
  1362. *** 3446,3451 ****
  1363. --- 3451,3457 ----
  1364.     /* Output the merged relocation info, if requested with `-r'.  */
  1365.     if (relocatable_output)
  1366.       write_rel ();
  1367. + #endif
  1368.   
  1369.     /* Output the symbol table (both globals and locals).  */
  1370.     write_syms ();
  1371. ***************
  1372. *** 3466,3474 ****
  1373. --- 3472,3486 ----
  1374.   write_header ()
  1375.   {
  1376.     outheader.a_info = magic;
  1377. + #if defined(ONLY_SYMBOLS)
  1378. +   outheader.a_text = 0;
  1379. +   outheader.a_data = 0;
  1380. +   outheader.a_bss = 0;
  1381. + #else
  1382.     outheader.a_text = text_size;
  1383.     outheader.a_data = data_size;
  1384.     outheader.a_bss = bss_size;
  1385. + #endif
  1386.     outheader.a_entry = (entry_symbol ? entry_symbol->value
  1387.                  : text_start + entry_offset);
  1388.   #ifdef COFF_ENCAPSULATE
  1389. ***************
  1390. *** 3592,3597 ****
  1391. --- 3604,3610 ----
  1392.   #endif
  1393.   }
  1394.   
  1395. + #if !defined(ONLY_SYMBOLS)
  1396.   /* Relocate the text segment of each input file
  1397.      and write to the output file.  */
  1398.   
  1399. ***************
  1400. *** 3614,3619 ****
  1401. --- 3627,3633 ----
  1402.   
  1403.     padfile (text_pad, outdesc);
  1404.   }
  1405. + #endif /* !ONLY_SYMBOLS */
  1406.   
  1407.   int
  1408.   text_offset (entry)
  1409. ***************
  1410. *** 3670,3675 ****
  1411. --- 3684,3691 ----
  1412.       }
  1413.   }
  1414.   
  1415. + #if !defined(ONLY_SYMBOLS)
  1416.   /* Read the text segment contents of ENTRY, relocate them,
  1417.      and write the result to the output file.
  1418.      If `-r', save the text relocation for later reuse.  */
  1419. ***************
  1420. *** 4073,4078 ****
  1421. --- 4089,4096 ----
  1422.       }
  1423.     mywrite (entry->datarel, 1, entry->header.a_drsize, outdesc);
  1424.   }
  1425. + #endif /* !ONLY_SYMBOLS */
  1426.   
  1427.   void write_file_syms ();
  1428.   void write_string_table ();
  1429.